 #include "VFormation.h"

VFormation::VFormation() : FormationBody(FormationState(VFORMATION)), INTER_SLOT_SPACE(50){
    scale(1);
};

VFormation::VFormation(int slotCount) : FormationBody(FormationState(VFORMATION)), INTER_SLOT_SPACE(50) {
    scale(slotCount);
}

void VFormation::createSpot(int spotIndex, int spotCount) {
    if (spotIndex == 0) {
        addSpot(new FormationSlot());

    } else {
        if (spotIndex%2 == 0) {
          if(spotIndex<=2){
            addSpot(new FormationSlot(-INTER_SLOT_SPACE, -INTER_SLOT_SPACE, 0, getSlotAt(0), spotIndex));
          }else{
            addSpot(new FormationSlot(-INTER_SLOT_SPACE, -INTER_SLOT_SPACE, 0, getSlotAt(spotIndex-2), spotIndex));
          }

        } else {
          if(spotIndex<=2){
            addSpot(new FormationSlot(-INTER_SLOT_SPACE, INTER_SLOT_SPACE, 0, getSlotAt(0), spotIndex));
          }else{
            addSpot(new FormationSlot(-INTER_SLOT_SPACE, INTER_SLOT_SPACE, 0, getSlotAt(spotIndex-2), spotIndex));
          }

        }
    }

}
